use rust_decimal::Decimal;
use serde::{Deserialize, Serialize};
use common_lib::BalanceType;

#[derive(Debug, Serialize, Deserialize)]
pub struct Balance {
    pub user_id: u32,
    pub asset: u16,
    pub t: BalanceType,
    pub value: Decimal,
}

impl Balance {
    pub fn new(user_id:u32,asset:u16,t:BalanceType,value:Decimal) -> Self {
        Self {
            user_id,
            asset,
            t,
            value,
        }
    }
}